#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: node10_custom.py 
@version:
@time: 2022/05/25 
"""
from TapClientCore.T04_logic.Dag02.node.operate_node.node08_field_rename import FieldRenameNode


class CustomNode(FieldRenameNode):
    """
    customNodeId:
    form: {"field_name":"title"}
    """

    def generate_node(self, operations):
        node = {
            "id": self.newId,
            "name": operations.get('custom_name'),
            "type": "custom_processor",
            "attrs": {
                "position": [
                    -500,
                    200
                ],
            },
            "icon": "custom-node",
            "catalog": "processor",
            "form": operations.get('form'),
            # "elementType": "Node",
            "processorThreadNum": 1,
            'customNodeId': operations.get('custom_id'),
        }
        self.node = node
